<template>
  <div>
    <img src="../assets/404.png" alt="" />
    <h2>404 没有找到页面</h2>
    <span>{{ rtime }} 秒后返回上一级</span>
  </div>
</template>

<script>
export default {
  data() {
    return {
      rtime: 5,
    };
  },
  methods: {
    nextf() {
      setInterval(() => {
        this.rtime--;
        if (this.rtime <= 0) {
          this.$router.go(-1);
        }
      }, 1000);
    },
  },
  mounted() {
    this.nextf();
  },
};
</script>

<style lang="less" scoped>
div {
  margin: 30px auto;
  text-align: center;
}
</style>